#include "CEncrypt.h"

CEncrypt* CEncrypt::singleton = 0;

CEncrypt::CEncrypt()
{
}

CEncrypt::~CEncrypt()
{
}

CEncrypt* CEncrypt::get_instance()
{
    if(!singleton)
    {
        singleton = new CEncrypt;
    }

    return singleton;
}

QString CEncrypt::encrypt(QString password)
{
    QByteArray byte_array = QCryptographicHash::hash(password.toUtf8(), QCryptographicHash::Sha1);
    return byte_array.toHex();
}
